﻿Namespace PL.MESSDK
    Public Class LotBusinessFlow_PL
        Inherits PLBase

        Public Sub New(ByVal queryName As String)
            MyBase.New(queryName)
        End Sub
        Public Overrides Function Delete() As Boolean
            Return True
        End Function

        Public Overrides Function Validate() As Boolean
            Return True
        End Function

        ''' <summary>
        ''' Retourne les cas possibles de cheminements.
        ''' Selon la transaction sur le type de lot que nous somme avec le statut actuel,
        ''' </summary>
        ''' <param name="tranTypeId"></param>
        ''' <param name="lotTypeId"></param>
        ''' <param name="fromLotStatusId"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Shared Function GetLotBusinessFlow(ByVal tranTypeId As Guid, ByVal lotTypeId As Guid, ByVal fromLotStatusId As Guid) As DataTable
            'faire la metaquery
            Dim mq As MetaQuery = MetaQuery.GetMetaQueryByName("LotBusFlow")
            mq.SQLWhere = String.Format("TranTypeId_FK = '{0}' AND LotTypeId_FK = '{1}' AND FromLotStatusId_FK = '{2}' AND NotSupported = 0", tranTypeId.ToString, lotTypeId.ToString, fromLotStatusId.ToString)
            mq.FillResultQuery()
            Return mq.ResultQuery
        End Function
        ''' Retourne les cas possibles de cheminements.
        Public Shared Function GetLotBusinessFlow(ByVal tranTypeId As Guid) As DataTable
            'faire la metaquery
            Dim mq As MetaQuery = MetaQuery.GetMetaQueryByName("LotBusFlow")
            mq.SQLWhere = String.Format("TranTypeId_FK = '{0}' AND NotSupported = 0", tranTypeId.ToString)
            mq.FillResultQuery()
            Return mq.ResultQuery
        End Function
    End Class
End Namespace
